using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class PipeManager : SingletonPattonMonoAutoBase<PipeManager>
{
    private void Start()
    {
        StartCoroutine(WaitLoad());
        Load();
    }
    IEnumerator WaitLoad()
    {
        yield return null;
    }
    private void Load()
    {
        float time = Random.Range(2f, 2.5f);
        float downnumber = Random.Range(-8f, -4f);
        Vector3 down = new Vector3(transform.position.x,downnumber, 0);
        Vector3 up = new Vector3(down.x, down.y + 12, 0);
        GameRoot.GetInstance().ObjectPool_Root.GetObj("PipeUp", up,Quaternion.Euler(0,0,-180));
        GameRoot.GetInstance().ObjectPool_Root.GetObj("PipeDown", down, Quaternion.identity);
        GameRoot.GetInstance().TimerManager_Root.StartTimer(time, Load, null);
    }
}
